package com.zhoukx.memento.theory;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName Caretaker
 * @Description:
 * @Author zhoukx
 * @Date 2020/8/18
 **/
public class Caretaker {

    private List<Memento > mementoList = new ArrayList<>();

    public  void add(Memento memento){
        mementoList.add(memento);
    }


    // 获取到第index个Originator中的emento对象
    public Memento get(int index){
        return mementoList.get(index);
    }
}
